package com.lsy.weizhi2.picture;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.lsy.weizhi2.R;
import com.zhy.autolayout.AutoFrameLayout;

/**
 * Created by 嗨哟 on 2016/12/21.
 */
public class Picture extends AutoFrameLayout {
    private String Tag="";
    private TextView picture_tv;
    private ImageView picture_iv;
    private Context context;
    public Picture(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.picture,this,true);
        this.context=context;
        Tag=context.getClass().getName();
        Log.i("Tag","Tag==="+Tag);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        picture_tv= (TextView) findViewById(R.id.picture_tv);
        picture_iv= (ImageView) findViewById(R.id.picture_iv);
    }
    public void setImage(Bitmap bitmap){
        picture_tv.setVisibility(View.GONE);
        picture_iv.setImageBitmap(bitmap);
    }
}
